﻿<Application
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:graph="clr-namespace:Graphviz.WPFront;assembly=GraphvizElements"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="Application"
	StartupUri="MainWindow.xaml">
    <Application.Resources>
        
    	<DataTemplate x:Key="TabItemHeader">
    		<Grid d:DesignWidth="56" d:DesignHeight="32" ClipToBounds="True">
    			<Grid.LayoutTransform>
    				<TransformGroup>
    					<ScaleTransform/>
    					<SkewTransform/>
    					<RotateTransform Angle="-90"/>
    					<TranslateTransform/>
    				</TransformGroup>
    			</Grid.LayoutTransform>
    			<Label Content="{Binding Mode=OneWay}" Margin="0" RenderTransformOrigin="0.5,0.5" Height="Auto" VerticalAlignment="Stretch">
    				<Label.LayoutTransform>
    					<TransformGroup>
    						<ScaleTransform/>
    						<SkewTransform/>
    						<RotateTransform Angle="0"/>
    						<TranslateTransform/>
    					</TransformGroup>
    				</Label.LayoutTransform>
    			</Label>
    		</Grid>
    	</DataTemplate>
    	<DataTemplate x:Key="NodeDataTemplate">
    		<Grid x:Name="grid" d:DesignWidth="400" d:DesignHeight="120">
    			<Grid.RowDefinitions>
    				<RowDefinition/>
    			</Grid.RowDefinitions>
    			<Grid.ColumnDefinitions>
    				<ColumnDefinition Width="128"/>
    				<ColumnDefinition/>
    			</Grid.ColumnDefinitions>
    			<Image Margin="8" Source="{Binding Image}"/>
    			<TextBox Grid.Column="1" HorizontalAlignment="Stretch" Margin="8,40,8,50.163" TextWrapping="Wrap" Text="{Binding Name}" Width="Auto"/>
    		</Grid>
    	</DataTemplate>
    	<Style x:Key="ImageButtonStyle" TargetType="{x:Type Button}">
    		<Setter Property="OverridesDefaultStyle" Value="True"/>
    		<Setter Property="Background" Value="Transparent"/>
    		<Setter Property="Cursor" Value="Hand"/>
    		<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
    		<Setter Property="HorizontalContentAlignment" Value="Center"/>
    		<Setter Property="VerticalContentAlignment" Value="Center"/>
    		<Setter Property="Padding" Value="3"/>
    		<Setter Property="Template">
    			<Setter.Value>
    				<ControlTemplate TargetType="{x:Type Button}">
    					<ContentPresenter x:Name="Presenter" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" RenderTransformOrigin="0.5,0.5"/>
    					<ControlTemplate.Triggers>
    						<Trigger Property="IsPressed" Value="True">
    							<Setter Property="RenderTransform" TargetName="Presenter">
    								<Setter.Value>
    									<TranslateTransform X="1" Y="1"/>
    								</Setter.Value>
    							</Setter>
    						</Trigger>
    					</ControlTemplate.Triggers>
    				</ControlTemplate>
    			</Setter.Value>
    		</Setter>
    	</Style>
    	<BitmapImage x:Key="PictureEditImage" CreateOptions="IgnoreImageCache" CacheOption="OnLoad" UriSource="E:\My Documents\Visual Studio 2010\Projects\Graphviz WPFront\Graphviz WPFront\picture_edit.png"/>
    	<DataTemplate x:Key="EdgeDataTemplate">
    		<Grid d:DesignWidth="320" d:DesignHeight="96">
    			<Grid.RowDefinitions>
    				<RowDefinition Height="Auto" MinHeight="72"/>
    				<RowDefinition Height="24"/>
    			</Grid.RowDefinitions>
    			<Grid.ColumnDefinitions>
    				<ColumnDefinition Width="56"/>
    				<ColumnDefinition Width="24"/>
    				<ColumnDefinition Width="*"/>
    				<ColumnDefinition Width="55.92"/>
    				<ColumnDefinition Width="24"/>
    			</Grid.ColumnDefinitions>
    			<Label Content="{Binding BeginNode.Name}" Margin="0" Grid.Row="1"/>
    			<Label Content="{Binding EndNode.Name}" Grid.Column="3" Margin="0" Grid.Row="1" Grid.ColumnSpan="1"/>
    			<Image Margin="8" Grid.RowSpan="1" Source="{Binding BeginNode.Image}" Grid.ColumnSpan="2"/>
    			<Image Grid.Column="3" Margin="8" Source="{Binding EndNode.Image}" Grid.ColumnSpan="2"/>
    			<Button Grid.Column="1" HorizontalAlignment="Stretch" Margin="0" Grid.Row="1" Style="{DynamicResource ImageButtonStyle}" Width="Auto">
    				<Image Height="Auto" StretchDirection="DownOnly" Source="{DynamicResource PictureEditImage}"/>
    			</Button>
    			<Button Grid.Column="4" HorizontalAlignment="Stretch" Margin="0" Grid.Row="1" Width="Auto" Style="{DynamicResource ImageButtonStyle}">
    				<Image Height="16" Width="16" Source="{DynamicResource PictureEditImage}"/>
    			</Button>
    			<Label Content="{Binding Label}" Grid.Column="2" Margin="8,24"/>
    		</Grid>
    	</DataTemplate>
        
    </Application.Resources>
</Application>
